package main

import (
	"Gee/day2-context/gee"
)

func main() {
	app := gee.NewEngin()
	app.GET("/string", func(context *gee.Context) {
		context.String(200, "HelloWold")
	})

	app.GET("/query", func(context *gee.Context) {
		queryString := context.Query("name")
		context.String(200, queryString)
	})

	app.POST("/json", func(context *gee.Context) {
		username := context.PostForm("username")
		password := context.PostForm("password")
		context.Json(200, gee.H{
			"username": username,
			"password": password,
		})
	})

	app.GET("/html", func(context *gee.Context) {
		context.Html(200, "<h1>HTML</h1>")
	})

	app.Run(":8080")

}
